/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller, middleware } = app;
  const auth = middleware.auth();

  // 基础接口
  router.get('/', controller.home.index);

  // 用户相关接口
  router.post('/api/user/login', controller.user.login);
  router.get('/api/user/status', auth, controller.user.checkLoginStatus);

  // 视频处理接口（需要登录）
  router.post('/api/video/process', auth, controller.video.processVideo);

  // 特效生成接口
  router.get('/api/effects/web', auth, controller.video.generateWebEffects);
  router.get('/api/effects/video', auth, controller.video.generateVideoEffects);
  router.post('/api/effects/download', auth, controller.video.downloadEffectsAsZip);
};
